import request from '@/utils/request.js'
// 区域列表
export const Regin = ({ pageIndex, pageSize }) => {
  return request({
    url: '/vm-service/region/search',
    method: 'GET',
    params: {
      pageIndex: pageIndex,
      pageSize: pageSize
    }
  })
}
// 新建区域
export const ReginXin = (data) => {
  return request({
    url: '/vm-service/region',
    method: 'POST',
    data
  })
}
// 编辑区域
export const ReginBian = (regionId) => {
  return request({
    url: `/vm-service/region/${regionId}`
  })
}
// 编辑功能
export function updateRole (data) {
  return request({
    url: `/vm-service/region/${data.id}`,
    method: 'put',
    data
  })
}
// 商圈列表
export function Business () {
  return request({
    url: '/vm-service/businessType',
    method: 'GET'
  })
}
// 合作商搜索
export function ParTner ({ pageIndex, pageSize, name }) {
  return request({
    url: '/user-service/partner/search',
    method: 'GET',
    params: {
      pageIndex: pageIndex,
      pageSize: pageSize,
      name: name
    }
  })
}
// 新增合作商
export function partners (data) {
  return request({
    url: '/user-service/partner',
    method: 'POST',
    data
  })
}
// 回显合作商
export function PartenXiu (id) {
  return request({
    url: `/user-service/partner/${id}`
  })
}
// 更改合作商
export function GenGai (data) {
  return request({
    url: `/user-service/partner/${data.id}`,
    method: 'PUT',
    data
  })
}
// 重置合作商密码
export function ResetPwd (id) {
  return request({
    url: `/user-service/partner/resetPwd/${id}`,
    method: 'PUT'
  })
}
// 删除合作商
export function Dealpar (id) {
  return request({
    url: `/user-service/partner/${id}`,
    method: 'DELETE'
  })
}
// 删除区域
export function delRole (id) {
  return request({
    url: `/vm-service/region/${id}`,
    method: 'delete'
  })
}
// 点位搜索
export function Nodes ({ pageIndex, pageSize, name, regionId }) {
  return request({
    url: '/vm-service/node/search',
    method: 'GET',
    params: {
      pageIndex: pageIndex,
      pageSize: pageSize,
      name: name,
      regionId: regionId
    }
  })
}
// 新增点位
export function NodeXin (data) {
  return request({
    url: '/vm-service/node',
    method: 'POST',
    data
  })
}
// 修改点位
export function Nodexiu (id) {
  return request({
    url: `/vm-service/node/${id}`
  })
}
// 删除点位
export function Nodedel (id) {
  return request({
    url: `/vm-service/node/${id}`,
    method: 'delete'
  })
}
// 点位详情
export function NodeVmlist (id) {
  return request({
    url: `/vm-service/node/vmList/${id}`
  })
}
